<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../templates/StaffTemplate.xhtml">

    <ui:define name="nav_menu">
        <p:menubar model="#{staffChangeInitialPasswordManagedBean.staffMenuModel}"/>
    </ui:define>

    <ui:define name="content">
        <h:form>
            <f:view beforePhase="#{staffChangeInitialPasswordManagedBean.initView}" >

                <p:panel id="staffDetail" header="#{bundle['staff.changeinitialpassword.panel']}"  >
                    <p:messages id="statusMessages" />

                    <h:panelGrid columns="3" cellpadding="5">
                        <h:outputLabel id="staffAccountUsernameLabel" value="#{bundle['staff.username.label']}" style="font-weight: bold"/>
                        <h:outputText id="username" value="#{staffChangeInitialPasswordManagedBean.username}" />
                        <p:message for="username" />

                        <h:outputLabel id="staffAccountNewPasswordLabel" value="#{bundle['staff.newpassword.label']}" style="font-weight: bold"/>
                        <p:password id="newpassword" value="#{staffChangeInitialPasswordManagedBean.newPassword}" binding="#{pw}" feedback="true" minLength="6" required="true" requiredMessage="#{bundle['staff.newpassword.required']}" validatorMessage="#{bundle['staff.password.validatorLength']}"> 
                            <f:validateLength minimum="6" />
                        </p:password>
                        <p:message for="newpassword" />

                        <h:outputLabel id="staffAccountConfirmPasswordLabel" value="#{bundle['staff.confirmpassword.label']}" style="font-weight: bold" />
                        <p:password id="confirmpassword" value="#{staffChangeInitialPasswordManagedBean.confirmPassword}" feedback="true" minLength="6" required="true" requiredMessage="#{bundle['staff.confirmpassword.required']}" >
                            <f:validator validatorId="matchPassword" />
                            <f:attribute name="pw" value="#{pw}" />
                        </p:password>
                        <p:message for="confirmpassword" />

                    </h:panelGrid>

                    <br/>
                    <p:commandButton id="staffAccountChangeButton" value="#{bundle['staff.change.button']}" update="staffDetail" actionListener="#{staffChangeInitialPasswordManagedBean.changeInitialPassword}" ajax="false" />
                </p:panel>
            </f:view>
        </h:form>
    </ui:define>

</ui:composition>

